package net.asfun.jvalog.misc;

import java.io.File;

public class FileUtil {

	public static String[] listDir(String path) {
		File file = new File(path);
		if ( file.isDirectory() ) {
			String[] res = new String[file.list().length];
			File[] dirs = file.listFiles();
			int i=0;
			for(File dir : dirs) {
				if ( dir.isDirectory() ) {
					res[i++] = dir.getName();
				}
			}
			String[] names = new String[i];
			System.arraycopy(res, 0, names, 0, i);
			return names;
		}
		return new String[0];
	}
}
